package sugar;

public class BridgeMethod {
    public static void main(String [] args){
        SuperClass superClass = new SubClass();
        System.out.println(superClass.method("123"));
        System.out.println(superClass.method(new Object()));
    }
}


interface SuperClass<T> {

    T method(T param);

}

class SubClass implements SuperClass<String> {
    public String method(String param) {
        return param;
    }

    //这样其实SubClass里会补一个桥接方法
    // public Object method(Object param){ return (Object)this.method((String)param); }
}